﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Web;

using OctoOS;
using OctoOS.UI;

public partial class samples_tree : OOSPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
		 // Add breadcrumbs
		 AddBreadcrumb("", Urls.GetHome());
		 AddBreadcrumb("Samples", Urls.Samples.GetHome());

		 // Initialize the tree
		 TextTreeNode textRootNode = new TextTreeNode("Text Nodes");
		 tree.Nodes.Add(textRootNode);

		 TextTreeNode selectableNode = new TextTreeNode("Selectable Node");
		 selectableNode.Selectable = true;
		 textRootNode.Nodes.Add(selectableNode);

		 TextTreeNode nonHoverableNode = new TextTreeNode("Non-hoverable Node");
		 nonHoverableNode.Hoverable = false;
		 textRootNode.Nodes.Add(nonHoverableNode);

		 TextTreeNode hyperlinkNode = new TextTreeNode("Hyperlink Node");
		 hyperlinkNode.HRef = Urls.Samples.GetHome();
		 textRootNode.Nodes.Add(hyperlinkNode);

		 TextTreeNode iconNode = new TextTreeNode("Text and Icon Node");
		 iconNode.Icon = "/samples/imgs/16/asterisk.png";
		 textRootNode.Nodes.Add(iconNode);

		 TextTreeNode cssClassNode = new TextTreeNode("Custom CSS Node");
		 cssClassNode.TitleClass = "redText";
		 textRootNode.Nodes.Add(cssClassNode);

		 TextTreeNode tooltipNode = new TextTreeNode("Node with Tooltip text");
		 tooltipNode.ToolTip = "This message appears as a tooltip";
		 textRootNode.Nodes.Add(tooltipNode);

		 TextTreeNode menuNode = new TextTreeNode("Context Menu Node");
		 menuNode.ContextMenu = "nodeMenu";
		 textRootNode.Nodes.Add(menuNode);

		 TextTreeNode contentNodes = new TextTreeNode("Content Nodes");
		 tree.Nodes.Add(contentNodes);

		 contentNodes.Nodes.Add(new ContentTreeNode(new Image48ObjectPreview(){
			 ImageUrl = "/samples/imgs/48/smile.png",
			 HeaderText = "Open Sample Homepage",
			 HeaderUrl = Urls.Samples.GetHome(),
			 Body = new Literal("Node content body"),
			 Footer = new Literal("Node content footer")
			}));
	 }
}